- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
Use relative visibility when noting sealed trait to reduce false positive #143431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
    Conversation
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
    Signed-off-by: xizheyin <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code need a bunch of cleanup.
        
          
                compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs
              
                Outdated
          
            Show resolved
            Hide resolved
        
      
              
                    compiler-errors
  
              
              requested changes
              
                  
                    Jul 4, 2025 
                  
              
              
            
            
        
          
                compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs
              
                Outdated
          
            Show resolved
            Hide resolved
        
      …tive Signed-off-by: xizheyin <[email protected]>
| @rustbot ready | 
              
                    compiler-errors
  
              
              approved these changes
              
                  
                    Jul 16, 2025 
                  
              
              
            
            
| @bors r+ rollup | 
    
  bors 
      added a commit
      that referenced
      this pull request
    
      Jul 17, 2025 
    
    
      
  
    
      
    
  
Rollup of 11 pull requests Successful merges: - #143326 (Remove deprecated `Error::description` impl from `c_str::FromBytesWithNulError`) - #143431 (Use relative visibility when noting sealed trait to reduce false positive) - #143550 (resolve: Use interior mutability for extern module map) - #143631 (update to literal-escaper-0.0.5) - #143793 (Opaque type collection: Guard against endlessly recursing free alias types) - #143880 (tests: Test line debuginfo for linebreaked function parameters) - #143914 (Reword mismatched-lifetime-syntaxes text based on feedback) - #143926 (Remove deprecated fields in bootstrap) - #143955 (Make frame spans appear on a separate trace line) - #143975 (type_id_eq: check that the hash fully matches the type) - #143984 (Fix ice for feature-gated `cfg` attributes applied to the crate) r? `@ghost` `@rustbot` modify labels: rollup
    
  github-actions bot
      pushed a commit
        to rust-lang/miri
      that referenced
      this pull request
    
      Jul 18, 2025 
    
    
      
  
    
      
    
  
Rollup of 11 pull requests Successful merges: - rust-lang/rust#143326 (Remove deprecated `Error::description` impl from `c_str::FromBytesWithNulError`) - rust-lang/rust#143431 (Use relative visibility when noting sealed trait to reduce false positive) - rust-lang/rust#143550 (resolve: Use interior mutability for extern module map) - rust-lang/rust#143631 (update to literal-escaper-0.0.5) - rust-lang/rust#143793 (Opaque type collection: Guard against endlessly recursing free alias types) - rust-lang/rust#143880 (tests: Test line debuginfo for linebreaked function parameters) - rust-lang/rust#143914 (Reword mismatched-lifetime-syntaxes text based on feedback) - rust-lang/rust#143926 (Remove deprecated fields in bootstrap) - rust-lang/rust#143955 (Make frame spans appear on a separate trace line) - rust-lang/rust#143975 (type_id_eq: check that the hash fully matches the type) - rust-lang/rust#143984 (Fix ice for feature-gated `cfg` attributes applied to the crate) r? `@ghost` `@rustbot` modify labels: rollup
  This was referenced Jul 21, 2025 
      
    
  Muscraft 
      pushed a commit
        to Muscraft/rust
      that referenced
      this pull request
    
      Jul 21, 2025 
    
    
      
  
    
      
    
  
Use relative visibility when noting sealed trait to reduce false positive Fixes rust-lang#143392 I used relative visibility instead of just determining if it's public or not. r? compiler
    
  Muscraft 
      pushed a commit
        to Muscraft/rust
      that referenced
      this pull request
    
      Jul 21, 2025 
    
    
      
  
    
      
    
  
…iaskrgr Rollup of 11 pull requests Successful merges: - rust-lang#143326 (Remove deprecated `Error::description` impl from `c_str::FromBytesWithNulError`) - rust-lang#143431 (Use relative visibility when noting sealed trait to reduce false positive) - rust-lang#143550 (resolve: Use interior mutability for extern module map) - rust-lang#143631 (update to literal-escaper-0.0.5) - rust-lang#143793 (Opaque type collection: Guard against endlessly recursing free alias types) - rust-lang#143880 (tests: Test line debuginfo for linebreaked function parameters) - rust-lang#143914 (Reword mismatched-lifetime-syntaxes text based on feedback) - rust-lang#143926 (Remove deprecated fields in bootstrap) - rust-lang#143955 (Make frame spans appear on a separate trace line) - rust-lang#143975 (type_id_eq: check that the hash fully matches the type) - rust-lang#143984 (Fix ice for feature-gated `cfg` attributes applied to the crate) r? `@ghost` `@rustbot` modify labels: rollup
    
  GuillaumeGomez 
      added a commit
        to GuillaumeGomez/rust
      that referenced
      this pull request
    
      Jul 23, 2025 
    
    
      
  
    
      
    
  
…ported-in-another-issue, r=fee1-dead Add more test case to check if the false note related to sealed trait suppressed Closes rust-lang#143121 I started to fix the issue but I found that this one has already been addressed in this PR (rust-lang#143431). I added an additional test to prove the reported thing has been resolved just in case. I think we can discard this pull request if there's no need to add such kind of tests👍🏻
    
  fmease 
      added a commit
        to fmease/rust
      that referenced
      this pull request
    
      Jul 23, 2025 
    
    
      
  
    
      
    
  
…ported-in-another-issue, r=fee1-dead Add more test case to check if the false note related to sealed trait suppressed Closes rust-lang#143121 I started to fix the issue but I found that this one has already been addressed in this PR (rust-lang#143431). I added an additional test to prove the reported thing has been resolved just in case. I think we can discard this pull request if there's no need to add such kind of tests👍🏻
    
  fmease 
      added a commit
        to fmease/rust
      that referenced
      this pull request
    
      Jul 23, 2025 
    
    
      
  
    
      
    
  
…ported-in-another-issue, r=fee1-dead Add more test case to check if the false note related to sealed trait suppressed Closes rust-lang#143121 I started to fix the issue but I found that this one has already been addressed in this PR (rust-lang#143431). I added an additional test to prove the reported thing has been resolved just in case. I think we can discard this pull request if there's no need to add such kind of tests👍🏻
    
  fmease 
      added a commit
        to fmease/rust
      that referenced
      this pull request
    
      Jul 24, 2025 
    
    
      
  
    
      
    
  
…ported-in-another-issue, r=fee1-dead Add more test case to check if the false note related to sealed trait suppressed Closes rust-lang#143121 I started to fix the issue but I found that this one has already been addressed in this PR (rust-lang#143431). I added an additional test to prove the reported thing has been resolved just in case. I think we can discard this pull request if there's no need to add such kind of tests👍🏻
    
  fmease 
      added a commit
        to fmease/rust
      that referenced
      this pull request
    
      Jul 24, 2025 
    
    
      
  
    
      
    
  
…ported-in-another-issue, r=fee1-dead Add more test case to check if the false note related to sealed trait suppressed Closes rust-lang#143121 I started to fix the issue but I found that this one has already been addressed in this PR (rust-lang#143431). I added an additional test to prove the reported thing has been resolved just in case. I think we can discard this pull request if there's no need to add such kind of tests👍🏻
    
  fmease 
      added a commit
        to fmease/rust
      that referenced
      this pull request
    
      Jul 24, 2025 
    
    
      
  
    
      
    
  
…ported-in-another-issue, r=fee1-dead Add more test case to check if the false note related to sealed trait suppressed Closes rust-lang#143121 I started to fix the issue but I found that this one has already been addressed in this PR (rust-lang#143431). I added an additional test to prove the reported thing has been resolved just in case. I think we can discard this pull request if there's no need to add such kind of tests👍🏻
    
  rust-timer 
      added a commit
      that referenced
      this pull request
    
      Jul 24, 2025 
    
    
      
  
    
      
    
  
Rollup merge of #144240 - yuk1ty:false-sealed-traits-note-reported-in-another-issue, r=fee1-dead Add more test case to check if the false note related to sealed trait suppressed Closes #143121 I started to fix the issue but I found that this one has already been addressed in this PR (#143431). I added an additional test to prove the reported thing has been resolved just in case. I think we can discard this pull request if there's no need to add such kind of tests👍🏻
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
      Labels
      
    S-waiting-on-bors
  Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 
  
    T-compiler
  Relevant to the compiler team, which will review and decide on the PR/issue. 
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Fixes #143392
I used relative visibility instead of just determining if it's public or not.
r? compiler